SuggestionBackedTextFieldWidget

A ValidationBackedTextFieldWidget that provides suggestions for string completion to the user

Author

fzzyhmstrs

Since

0.2.0

Parameters

width

Int - the width of the widget in pixels

height

Int - the height of the widget in pixels

wrappedValue

Supplier - supplies strings to the text field for display

choiceValidator

ChoiceValidator - additional choice validation, if any. Generally this can be ChoiceValidator.any

validator

EntryValidator - String validation provider see EntryValidator.Builder for more details on validation construction

applier

Consumer - accepts newly valid user inputs.

suggestionProvider

SuggestionProvider - provides the valid suggestions for the user

closePopup

Boolean - if true, this window will 'pop' the latest PopupWidget, if any.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, wrappedValue: Supplier<String>, choiceValidator: ChoiceValidator<String>, validator: EntryValidator<String>, applier: Consumer<String>, suggestionProvider: SuggestionBackedTextFieldWidget.SuggestionProvider)
constructor(width: Int, height: Int, wrappedValue: Supplier<String>, choiceValidator: ChoiceValidator<String>, validator: EntryValidator<String>, applier: Consumer<String>, suggestionProvider: SuggestionBackedTextFieldWidget.SuggestionProvider, closePopup: Boolean)

Types

Link copied to clipboard
fun interface SuggestionProvider

Interface for providing suggestions into the widget based on current widget and validator state.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var message: Text
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var x: Int
Link copied to clipboard
var y: Int

Functions

Link copied to clipboard
open override fun addListener(listener: SuggestionWindowListener)
Link copied to clipboard
open override fun appendClickableNarrations(builder: NarrationMessageBuilder)
Link copied to clipboard
override fun appendNarrations(builder: NarrationMessageBuilder)
Link copied to clipboard
fun appendValueNarrations(builder: NarrationMessageBuilder)
Link copied to clipboard
open override fun charTyped(chr: Char, modifiers: Int): Boolean
Link copied to clipboard
Link copied to clipboard
open fun eraseCharacters(characterOffset: Int)
Link copied to clipboard
open fun eraseCharactersTo(position: Int)
Link copied to clipboard
open fun eraseWords(wordOffset: Int)
Link copied to clipboard
open override fun forEachChild(consumer: Consumer<ClickableWidget>)
Link copied to clipboard
open fun getBottom(): Int
Link copied to clipboard
open fun getCharacterX(index: Int): Int
Link copied to clipboard
open fun getCursor(): Int
Link copied to clipboard
@Nullable
open fun getFocusedPath(): GuiNavigationPath?
Link copied to clipboard
open override fun getHeight(): Int
Link copied to clipboard
open override fun getNavigationFocus(): ScreenRect
Link copied to clipboard
@Nullable
open override fun getNavigationPath(navigation: GuiNavigation): GuiNavigationPath?
Link copied to clipboard
open fun getRight(): Int
Link copied to clipboard
Link copied to clipboard
@Nullable
open fun getTooltip(): Tooltip?
Link copied to clipboard
open override fun getType(): Selectable.SelectionType
Link copied to clipboard
Link copied to clipboard
open override fun getWidth(): Int
Link copied to clipboard
open fun getWordSkipPosition(wordOffset: Int): Int
Link copied to clipboard
open fun isActive(): Boolean
Link copied to clipboard
open fun isHovered(): Boolean
Link copied to clipboard
open override fun isMouseOver(mouseX: Double, mouseY: Double): Boolean
Link copied to clipboard
open override fun isNarratable(): Boolean
Link copied to clipboard
open fun isSelected(): Boolean
Link copied to clipboard
open fun isVisible(): Boolean
Link copied to clipboard
open override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open fun keyReleased(keyCode: Int, scanCode: Int, modifiers: Int): Boolean
Link copied to clipboard
open override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, deltaX: Double, deltaY: Double): Boolean
Link copied to clipboard
open fun mouseMoved(mouseX: Double, mouseY: Double)
Link copied to clipboard
open override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean
Link copied to clipboard
open override fun mouseScrolled(mouseX: Double, mouseY: Double, horizontalAmount: Double, verticalAmount: Double): Boolean
Link copied to clipboard
open fun moveCursor(offset: Int, shiftKeyPressed: Boolean)
Link copied to clipboard
open override fun onClick(mouseX: Double, mouseY: Double)
Link copied to clipboard
open fun onRelease(mouseX: Double, mouseY: Double)
Link copied to clipboard
open override fun playDownSound(soundManager: SoundManager)
Link copied to clipboard

Pushes changes stored in this widget into the linked applier. This is typically used to force immediate visual updates in the GUI.

Link copied to clipboard
override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)
Link copied to clipboard
open override fun renderWidget(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float)
Link copied to clipboard
open fun setAlpha(alpha: Float)
Link copied to clipboard
open fun setCursor(cursor: Int, shiftKeyPressed: Boolean)
Link copied to clipboard
open fun setCursorToEnd(shiftKeyPressed: Boolean)
Link copied to clipboard
open fun setCursorToStart(shiftKeyPressed: Boolean)
Link copied to clipboard
open fun setDimensions(width: Int, height: Int)
Link copied to clipboard
open fun setDimensionsAndPosition(width: Int, height: Int, x: Int, y: Int)
Link copied to clipboard
open fun setDrawsBackground(drawsBackground: Boolean)
Link copied to clipboard
open fun setEditable(editable: Boolean)
Link copied to clipboard
open fun setEditableColor(editableColor: Int)
Link copied to clipboard
open fun setFocusUnlocked(focusUnlocked: Boolean)
Link copied to clipboard
open fun setHeight(height: Int)
Link copied to clipboard
open fun setPlaceholder(placeholder: Text)
Link copied to clipboard
open fun setPosition(x: Int, y: Int)
Link copied to clipboard
open fun setRenderTextProvider(renderTextProvider: BiFunction<String, Int, OrderedText>)
Link copied to clipboard
open fun setSelectionEnd(index: Int)
Link copied to clipboard
open fun setSelectionStart(cursor: Int)
Link copied to clipboard
open fun setSuggestion(@Nullable suggestion: String?)
Link copied to clipboard
open fun setTextPredicate(textPredicate: Predicate<String>)
Link copied to clipboard
open fun setTooltip(@Nullable tooltip: Tooltip?)
Link copied to clipboard
open fun setTooltipDelay(tooltipDelay: Duration)
Link copied to clipboard
open fun setUneditableColor(uneditableColor: Int)
Link copied to clipboard
open fun setVisible(visible: Boolean)
Link copied to clipboard
open fun setWidth(width: Int)
Link copied to clipboard
open fun write(text: String)